import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SacrificeandrenovateVO, SacrificeandrenovateForm, SacrificeandrenovateQuery } from '@/api/cemetery/sacrificeandrenovate/types';

/**
 * 查询云祭扫列表
 * @param query
 * @returns {*}
 */

export const listSacrificeandrenovate = (query?: SacrificeandrenovateQuery): AxiosPromise<SacrificeandrenovateVO[]> => {
  return request({
    url: '/cemetery/sacrificeandrenovate/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询云祭扫详细
 * @param id
 */
export const getSacrificeandrenovate = (id: string | number): AxiosPromise<SacrificeandrenovateVO> => {
  return request({
    url: '/cemetery/sacrificeandrenovate/' + id,
    method: 'get'
  });
};

/**
 * 新增云祭扫
 * @param data
 */
export const addSacrificeandrenovate = (data: SacrificeandrenovateForm) => {
  return request({
    url: '/cemetery/sacrificeandrenovate',
    method: 'post',
    data: data
  });
};

/**
 * 修改云祭扫
 * @param data
 */
export const updateSacrificeandrenovate = (data: SacrificeandrenovateForm) => {
  return request({
    url: '/cemetery/sacrificeandrenovate',
    method: 'put',
    data: data
  });
};

/**
 * 删除云祭扫
 * @param id
 */
export const delSacrificeandrenovate = (id: string | number | Array<string | number>) => {
  return request({
    url: '/cemetery/sacrificeandrenovate/' + id,
    method: 'delete'
  });
};
